package com.ssl.design.factory1;

/**
 * 描述：简单工厂模式
 *
 * @author shi_senlin
 * @create 2021/07/06 21:52
 */
public class CpuFactory {
    public static Cpu createCpu(Class classType) {
        if (ACpu.class.getName().equals(classType.getName())) {
            return new ACpu();
        } else if (BCpu.class.getName().equals(classType.getName())) {
            return new BCpu();
        }
        return null;
    }
}
